{% extends "layout.html" %}

{% block title %}Brand View{% endblock %}


{% block content %}
<ul class="nav nav-tabs custom-tab">
    <li class="active"><a href="#" data-toggle="tab"><i class="icon-list"></i><span>Accessory</span></a></li>
    <li><a href="{{ base_url }}admin/accessory.php?action=add" data-toggle="tab"><i class="icon-plus"></i><span>Add Accessory</span></a></li>
</ul>
<div class="user-list">
    <h2>Accessory Management</h2>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
            <tr>
                <th>Photo</th>
                <th>Name</th>
                <th>Brand</th>
                <th>Add By</th>
                <th>Remark</th>
                <th>Action</th>
            </tr>

        </thead>
        <tbody>
            {% for accessory in accessories %}
            <tr>
                 <td>  <img src="{{base_url}}timthumb.php?src={{base_url}}pictures/accessories/{{accessory.photo}}&h=80&w=210&zc=1" />  </td>
                <td>{{ accessory.name }}</td>
                <td>{{ accessory.brand }}</td>
                <td>{{ accessory.user }}</td>
                <td>{{ accessory.remark }}</td>
                <td>
                    <a href="{{base_url}}admin/accessory.php?action=edit&acc_id={{ accessory.id }}" rel="tooltip" title="Edit" ><i class=" icon-pencil"></i></a>
                    <a href="{{base_url}}admin/accessory.php?action=view&acc_id={{ accessory.id }}" rel="tooltip" title="View"><i class="icon-eye-open"></i></a>
                    <a href="{{base_url}}admin/accessory.php?action=delete&acc_id={{ accessory.id }}" rel="tooltip" title="Delete" class="delete"><i class="icon-remove"></i></a>
                </td>
            </tr>  
            {% endfor %}
        </tbody>
    </table>
</div>
<div id="modalDelete" class="modal hide">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">x</button>
        <h3>Confirm Delete Accessory</h3>
    </div>
    <div class="modal-body">
        <p>Do you want to Delete Accessory?</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">No</a>
        <a href="#" id="deleteLink" class="btn btn-primary">Yes</a>
    </div>
</div>
<script src="{{base_url}}/admin/js/bootstrap-modal.js"></script>
<script>
    $(document).ready(function(){
        $('a[rel="tooltip"]').tooltip();
        
        //Delete user
        $('.delete').click(function(e){
            var deleteURL = $(this).attr('href');
            $('#deleteLink').attr('href', deleteURL);
            
            $('#modalDelete').modal({
                keyboard: false
                
            });
            e.preventDefault();
        })
        
    })
</script>
{% endblock %}